function getPlayInfo(copyrightId, type) {
    var t = {
        raw: {
            auditionsFlag: 0,
            copyrightId: copyrightId,
            type: type
        },
        rawType: 2
    }
    var res = h(t);
    var data = encodeURIComponent(res.data);
    var secKey = encodeURIComponent(res.secKey)
    var url = "https://music.migu.cn/v3/api/music/audioPlayer/getPlayInfo?dataType=2&data=" + data + "&secKey=" + secKey;
    return url;
}


function h(t) {
    var e;
    1 === t.rawType ? e = t.raw : 2 === t.rawType && (e = JSON.stringify(t.raw));

    var publicKey =
        "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8asrfSaoOb4je+DSmKdriQJKW\nVJ2oDZrs3wi5W67m3LwTB9QVR+cE3XWU21Nx+YBxS0yun8wDcjgQvYt625ZCcgin\n2ro/eOkNyUOTBIbuj9CvMnhUYiR61lC1f1IGbrSYYimqBVSjpifVufxtx/I3exRe\nZosTByYp4Xwpb1+WAQIDAQAB\n-----END PUBLIC KEY-----"

    var decrypt = new JSEncrypt();
    decrypt.setPublicKey(publicKey);
    var n = "4ea5c508a6566e76240543f8feb06fd457777be39549c4016436afda65d2330e".substr(0, 32);
    var r = encrypt(e, n);
    var a = decrypt.encrypt(n);
    return {
        dataType: t.rawType,
        data: r,
        secKey: a
    }
}

function encrypt(data, key) { //key,iv：16位的字符串
    // return CryptoJS.AES.encrypt(data, key).toString();
    var iv = CryptoJS.enc.Utf8.parse("4ea5c508a6566e76240543f8feb06fd457777be39549c4016436afda65d2330e".substr(0, 16));
    var decryptedData = CryptoJS.AES.encrypt(data, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    });
    return decryptedData.toString();
}
